import { BasicColumn } from '/@/components/Table/src/types/table';
import { FormSchema } from '/@/components/Form';

import { useI18n } from '/@/hooks/web/useI18n';

const { t } = useI18n();

export function getUserColumns(): BasicColumn[] {
  return [
    {
      title: t('routes.components.permissionModal.userId'),
      dataIndex: 'id',
      fixed: 'left',
      align: 'left',
      width: 150,
    },
    {
      title: t('routes.components.permissionModal.username'),
      dataIndex: 'name',
      align: 'center',
      width: 150,
      slots: { customRender: 'name' },
    },
  ];
}

export function getDirectoryColumns(): BasicColumn[] {
  return [
    {
      title: t('routes.components.documentReuseModal.catalogName'),
      dataIndex: 'title',
      align: 'left',
      slots: { customRender: 'title' },
    },
  ];
}

export function getPerSettingColumns(): BasicColumn[] {
  return [
    {
      title: t('routes.components.permissionSettingModal.permissionName'),
      dataIndex: 'resourceName',
      align: 'left',
    },
  ];
}

export function getDocVersionColumns(): BasicColumn[] {
  return [
    {
      title: '图档代号',
      dataIndex: 'ThitObjectId',
      fixed: 'left',
      width: 200,
    },
    {
      title: '图档名称',
      dataIndex: 'filename',
      width: 150,
    },
    {
      title: '版本',
      dataIndex: 'version',
      width: 80,
    },
    {
      title: '创建人',
      dataIndex: 'creater',
      width: 80,
    },
    {
      title: '创建日期',
      dataIndex: 'createtime',
      width: 100,
      slots: { customRender: 'createtime' },
    },
    {
      title: '源文件名',
      dataIndex: 'name',
      width: 100,
    },
    {
      title: '安全级别',
      dataIndex: 'securitylevel',
      width: 80,
    },
    {
      title: '文件类型',
      dataIndex: 'filetype',
      width: 100,
    },
  ];
}
export function CompareForm(): FormSchema[] {
  return [
    {
      field: 'oId',
      component: 'Input',
      label: t('routes.demo.documentManager.tableData.code'),
      componentProps: {
        placeholder: t('routes.demo.documentManager.tableData.codePlaceholder'),
        disabled: true,
      },
      ifShow: false,
    },
    {
      field: 'name',
      component: 'Input',
      label: t('routes.demo.documentManager.tableData.code'),
      componentProps: {
        placeholder: t('routes.demo.documentManager.tableData.codePlaceholder'),
        disabled: true,
      },
    },
    {
      field: 'filename',
      component: 'Input',
      label: t('routes.demo.documentManager.tableData.name'),
      componentProps: {
        placeholder: t('routes.demo.documentManager.tableData.namePlaceholder'),
        disabled: true,
      },
    },
    {
      field: 'version',
      component: 'Input',
      label: t('routes.demo.documentManager.tableData.version'),
      componentProps: {
        placeholder: t('routes.demo.documentManager.tableData.versionPlaceholder'),
        disabled: true,
      },
    },
  ];
}
export function ComparedForm(): FormSchema[] {
  return [
    {
      field: 'oId',
      component: 'Input',
      label: t('routes.demo.documentManager.tableData.code'),
      componentProps: {
        placeholder: t('routes.demo.documentManager.tableData.codePlaceholder'),
        disabled: true,
      },
      ifShow: false,
    },
    {
      field: 'name',
      component: 'Input',
      label: t('routes.demo.documentManager.tableData.code'),
      componentProps: {
        placeholder: t('routes.demo.documentManager.tableData.codePlaceholder'),
        disabled: true,
      },
    },
    {
      field: 'filename',
      component: 'Input',
      label: t('routes.demo.documentManager.tableData.name'),
      componentProps: {
        placeholder: t('routes.demo.documentManager.tableData.namePlaceholder'),
        disabled: true,
      },
    },
    {
      field: 'version',
      component: 'Input',
      label: t('routes.demo.documentManager.tableData.version'),
      componentProps: {
        placeholder: t('routes.demo.documentManager.tableData.versionPlaceholder'),
        disabled: true,
      },
    },
  ];
}
